using System;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;

namespace VotingSystem.Models
{
    public class VoteRecord
    {
        [Key]
        public int Id { get; set; }

        [Required]
        public int VoteId { get; set; }

        [Required]
        public int OptionId { get; set; }

        public string? UserId { get; set; }

        public DateTime VoteTime { get; set; }

        public string? IPAddress { get; set; }

        public int? Rating { get; set; }

        public int SelectedOptionsCount { get; set; }

        [ForeignKey("VoteId")]
        public Vote? Vote { get; set; }

        [ForeignKey("OptionId")]
        public VoteOption? Option { get; set; }

        [ForeignKey("UserId")]
        public ApplicationUser? User { get; set; }
    }
} 